package com.sys.core.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class OrderNumUtils {
	/**
	 * Created by cc 
	 * 生成订单号
	 * uuid: db30cc85-3387-4845-87bc-dc390b55b7ea 前8位 + 201508171108900(yyMMddHHMMSS)
	 * 即： db30cc85201508171108900
	 */
	/**
	 * 0美食1车票2船票
	 * 1活动 2 商品 3会员 4我的奖品
	 * @param manageType
	 * @author 汤伟杰
	 * @return
	 */
	public static  String getOrderNo(int manageType){
		String orderNo = "";
		String trandNo = String.valueOf((Math.random() * 9 + 1) * 1000000);
		String sdf = new SimpleDateFormat("yyyyMMdd").format(new Date());
		orderNo = sdf +manageType+ trandNo.replace(".", "").substring(0, 10);
	    return orderNo ;
	}
	public static void main(String[] args) {
		String orderno = OrderNumUtils.getOrderNo(4);
		System.out.println(orderno);
	}
}
